<?php

/**
 * Framework_Header 
 *
 * @author      Ian Szewczyk <roamzero@gmail.com>
 * @copyright   (c) 2007 Ian Szewczyk. All rights reserved.
 * @license     http://www.opensource.org/licenses/bsd-license.php
 * @package Framework
 * @filesource
 */

require_once 'HTTP/Header.php';


/**
 * Framework_Header 
 *
 * @package Framework
 */
abstract class Framework_Header 
{
	 /**
     * $instance
     *
     * Instance variable used for singleton pattern. Stores a single instance
     * of HTTP_Header.
     *
     * @access private
     * @static
     * @var mixed $instance
     */
	 private static $instance;
	
	/**
     * singleton
     * 
     * Implementation of the singleton pattern. Returns a sincle instance
     * of PEAR's HTTP_Header class
     * 
     * @access public
     * @static 
     * @return HTTP_Header Instance of HTTP_Header
     */
    public static function singleton()
    {
        if (!isset(self::$instance)) {
            
            self::$instance = new HTTP_Header();
        }

        return self::$instance;
    }
    
    /**
	 * redirect
	 *
	 * @access  public
	 * @param	string		$url
	 * @param	array		$param	
	 * @param	boolean		$session
	 * @return  void
	 * @static
	 */
    public static function redirect($url = null, $param = array(), $session = false) 
    {
    	Framework::stop();
    	HTTP_Header::redirect($url, $param, $session);
    	exit(0);
    }
}

?>